<template>
	<view class="card">
		子组件
		<button @click="onClick">按钮</button>
		<!-- $emit('add',Math.random()) -->	
		<input placeholder="请输入" type="text" @input="onInput"/>
	</view>
</template>

<script setup>
const emit = defineEmits(["add","change"])
function onClick(){
	emit("add",Math.random())
}
function onInput(e){	
	emit("change",e.detail.value)
}
</script>

<style lang="scss" scoped>
.card{
 border: 1px solid rgb(182, 177, 177);
 margin: 5px;
 border-radius: 5px;
 padding: 5px;

}

input{
	margin-top: 10px;
	border:1px solid #cfcfcf;
	height: 40px;
}
</style>